load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files")

sh_binary(
    name = "qltest",
    srcs = ["qltest.sh"],
    visibility = ["//swift/tools/test/qltest:__pkg__"],
)

sh_binary(
    name = "autobuild",
    srcs = ["autobuild.sh"],
)

sh_binary(
    name = "identify-environment",
    srcs = ["identify-environment.sh"],
)

pkg_files(
    name = "scripts",
    srcs = [
        "autobuild.cmd",
        ":autobuild",
        ":identify-environment",
        ":qltest",
    ],
    attributes = pkg_attributes(mode = "0755"),
    prefix = "tools",
)

pkg_files(
    name = "tracing-config",
    srcs = ["tracing-config.lua"],
    prefix = "tools",
)

pkg_filegroup(
    name = "tools",
    srcs = [
        ":scripts",
        ":tracing-config",
    ],
    visibility = ["//swift:__pkg__"],
)
